package com.example.springbootfoodsafety.serviceimpl;

import com.example.springbootfoodsafety.dao.ArtcleDao;
import com.example.springbootfoodsafety.dao.ManageDao;
import com.example.springbootfoodsafety.po.Article;
import com.example.springbootfoodsafety.service.ArtcleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArtcleServiceImpl implements ArtcleService {
    @Autowired
    private ArtcleDao dao;
    @Override
    public String getTagName(Integer id) {
        return dao.getTagName(id);
    }

    @Override
    public Integer getView(Integer id) {
        return dao.getView(id);
    }

    @Override
    public boolean modifyView(Integer id, Integer count) {
        return dao.modifyView(id,count);
    }


    @Override
    public boolean modifyZan(Integer id) {
        int counts=dao.getZan(id);

        return dao.modifyZan(id,++counts);
    }

    @Override
    public Integer getZan(Integer id) {
        return dao.getZan(id);
    }

    @Override
    public List<Article> getTagForId(Integer id) {
        return dao.getTagForId(id);
    }


}
